<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <canvas id="canvas" width="600" height="400"></canvas>
  <script>
    /** @type {HTMLCanvasElement} */
    var canvas=document.querySelector("#canvas")
    var ctx=canvas.getContext("2d")
    var img=new Image()
    img.src="./img/001.jpg"
    img.onload=function(){
      ctx.drawImage(img,280,100,600,600,0,0,400,400)
    }
  </script>
</body>
</html>